﻿/*****************************************************************//**
 * @file   VAOneXMLAdaptorFEMaterials.h
 * @brief  VAOne读写FE材料适配器
 *
 * @author  lilongyuan (lilongyuan@diso.cn)
 * @date    2025-02-18
 *********************************************************************/
#ifndef VAONEXMLADAPTORFEMATERIALS_H
#define VAONEXMLADAPTORFEMATERIALS_H

#include "FITKAbstractVAOneXMLAdaptor.h"

namespace Interface
{
    class FITKAbaMaterial;
}

namespace IO
{
    /**
     * @brief   VAOne读写FE材料适配器
     * @author  lilongyuan (lilongyuan@diso.cn)
     * @date    2025-02-18
     */
    class FITKVAOneXMLIOAPI VAOneXMLAdaptorFEMaterials : public FITKAbstractVAOneXMLAdaptor
    {
        FITKCLASS(IO, VAOneXMLAdaptorFEMaterials);
    public:
        /**
         * @brief   构造函数
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-18
         */
        explicit VAOneXMLAdaptorFEMaterials() = default;
        /**
         * @brief   析构函数
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-18
         */
        ~VAOneXMLAdaptorFEMaterials() = default;
        /**
         * @brief   适配器读数据
         * @return  是否执行成功
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-18
         */
        bool adaptR() override;
        /**
         * @brief   适配器写数据
         * @return  是否执行成功
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-18
         */
        bool adaptW() override;
    private:
        /**
         * @brief     读取FE材料数据
         * @param[i]  node FEMaterials节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-19
         */
        bool readFEMaterial(rapidxml::xml_node<char>* node);
        /**
         * @brief     读取FEfield节点数据
         * @param[i]  node FEMaterial节点，data 结构模板材料类型数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-19
         */
        bool readFEfield(rapidxml::xml_node<char>* node, Interface::FITKAbaMaterial* data);
    private:
        /**
         * @brief     写出FE材料数据
         * @param[i]  node FEMaterial节点，data 结构模板材料类型数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-19
         */
        bool writeFEMaterial(rapidxml::xml_node<char>* node, Interface::FITKAbaMaterial* data);
        /**
         * @brief     写出FEfield节点数据
         * @param[i]  node FEMaterial节点，data 结构模板材料类型数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-19
         */
        bool writeFEfield(rapidxml::xml_node<char>* node, Interface::FITKAbaMaterial* data);
        /**
         * @brief     写出弹性材料行为数据
         * @param[i]  node FEMaterial节点，data 结构模板材料类型数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-19
         */
        bool wirteElastic(rapidxml::xml_node<char>* node, Interface::FITKAbaMaterial* data);
        /**
         * @brief     写出密度材料行为数据
         * @param[i]  node FEMaterial节点，data 结构模板材料类型数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-19
         */
        bool wirteDensity(rapidxml::xml_node<char>* node, Interface::FITKAbaMaterial* data);
        /**
         * @brief     写出热膨胀材料行为数据
         * @param[i]  node FEMaterial节点，data 结构模板材料类型数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-19
         */
        bool wirteExpansion(rapidxml::xml_node<char>* node, Interface::FITKAbaMaterial* data);
        /**
         * @brief     写出阻尼材料行为数据
         * @param[i]  node FEMaterial节点，data 结构模板材料类型数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-19
         */
        bool wirteDamping(rapidxml::xml_node<char>* node, Interface::FITKAbaMaterial* data);
    };

    Register2FITKIOAdaptorFactory(VAOneXML, FEMaterials, VAOneXMLAdaptorFEMaterials)
}

#endif // VAONEXMLADAPTORFEMATERIALS_H

